home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / compress / zip2zi31.zip / ZIP2ZIP.BAT < prev    next >
DOS Batch File  |  1993-05-31  |  4KB  |  111 lines

  1. @Echo off
  2. Rem Zip2zip.Bat Ver 3.0ß -By Robert Boone-
  3. Rem To Convert (Re-zip) all files within a .ZIP fileset to
  4. Rem PKZIP 2.04g max compression. (*IS* Version Specific To Function)
  5. Rem Supports D:\PATH\ and Runs From: 1. In path, 2. From It's SubDir.
  6. Rem Does Support WildCard ZipName. Does NOT support mult-filenames on cmd line.
  7.  
  8.    IF "%1"=="" GoTo Syntax
  9.    IF "%2"=="" GoTo Syntax
  10.    IF Exist    ZIP2-FSZ.        Del    ZIP2-FSZ.    >Nul
  11.    IF Exist    ZIP2-FSZ.$$$     Del    ZIP2-FSZ.$$$ >Nul
  12.    IF Exist    EV0.FLG          Del    EV0.FLG      >Nul
  13.    IF Exist    TEMP_$$$.BAT     Del    TEMP_$$$.BAT >Nul
  14.  
  15.    IF "%ZXPERT%"=="ON"          GoTo EV_OK
  16.    IF "%ZXPERT%"=="on"          GoTo EV_OK
  17.  
  18.       Call Zip2ZipA.Bat
  19.         IF Exist EV0.FLG        GoTo OUT_ENV
  20.  
  21. :EV_OK
  22.       Set EVCHK40=
  23.       Set EVCHK30=
  24.  
  25. Rem                             v----When/if newer version, modify this line.
  26.    PKZIP -L | Find "Version 2.04g" >ZIP2-FSZ.
  27.    Call ZIP2-FSZ.BAT
  28.       IF "%FSIZE%"==""          GoTo MajorError
  29.       IF "%FSIZE%"=="0"         GoTo Wrong_PK
  30.  
  31.    Echo PKZIP 2.04g Found OK.
  32.    Set  CNZL=
  33.    IF Not Exist %1%2.ZIP        GoTo OOPS
  34.  
  35.    Set SAFETY=0Ff
  36.    Call ZIP2-SDE.BAT %1 Z_B
  37.       IF     "%FSIZE%"==""      GoTo MajorError
  38.       IF NOT "%FSIZE%"=="0"     GoTo REQ_SD
  39.  
  40. :NO_Z_B
  41.    IF Exist %1ZIP2ZIP.CVT DEL %1ZIP2ZIP.CVT >Nul
  42.    Echo.                                                      >>%1ZIP2ZIP.LOG
  43.    Echo           Starting Session at %ZTIME% on %ZDATE% %OS% >>%1ZIP2ZIP.LOG
  44.    Dir %1%2.ZIP | Find "file(s)"                              >>%1ZIP2ZIP.LOG
  45.  
  46.    For %%f IN (ZTIME ZDATE FZIZE) DO Set %%f=
  47.    Echo Zip2Zip.Bat (Master Executing)
  48.  
  49. Rem  ========== Starting ZIP2ZIP Conversion(s) ===========
  50.    For %%f in (%1%2.ZIP)  DO Call Zip2zipB.Bat %1 %%f
  51. Rem  ========== Ending   ZIP2ZIP Conversion(s) ===========
  52.    Echo    Doing Final Processing...Closing Log.
  53.  
  54.    IF NOT Exist %1ZIP2ZIP.CVT GoTo NONE_PROC
  55.      Echo ..Recapping This Session. The Following Files Were Processed Successfully >>%1ZIP2ZIP.LOG
  56.      IF Exist %1ZIP2ZIP.$$$ Del %1ZIP2ZIP.$$$                 >Nul
  57.      Ren      %1ZIP2ZIP.LOG       ZIP2ZIP.$$$                 >Nul
  58.      Copy     %1ZIP2ZIP.$$$  +  %1ZIP2ZIP.CVT %1ZIP2ZIP.LOG/B >Nul
  59.      Del      %1ZIP2ZIP.$$$                                   >Nul
  60.  
  61. :NONE_PROC
  62.    Dir %1%2.ZIP | Find "file(s)"                              >>%1ZIP2ZIP.LOG
  63.    Echo           Ending   Session at %ZTIME% on %ZDATE% %OS% >>%1ZIP2ZIP.LOG
  64.    IF NOT "%SAFETY%"==""   GoTo End
  65.    Echo       !!! Aborted By Operator or Procedure Error !!!  >>%1ZIP2ZIP.LOG
  66.    GoTo End                                                     
  67.  
  68. Rem ==================== Error Cheching ==========================
  69. :Out_Env
  70.     Echo Not Enough Environment Size to Run. Increase in SHELL or
  71.     Echo issue SET  look at, remove some not required by SET YourSelection=
  72.     GoTo End
  73.  
  74. :Syntax
  75. CLS
  76. Echo  For Re-zipping a .ZIP file possibly created under pkzip 1.10 with 2.0x
  77. Echo  %%1 is Existing Drive:\path\ (K:\Dir30\), %%2 is ZipName (No ., No .zip ext)
  78. Echo  DO add the "\" trailing backslash!  a "*" As %%2 Will Re-Zip all .ZIPs
  79. Echo.
  80. Echo  Example ZIP2ZIP \DIR20\ *          (DOES ALL ZIPS In DIR20.. on Default Drive)
  81. Echo       Or ZIP2ZIP G:\DIR20\ ABC_XYZ  (DOES ABC_XYZ.ZIP Only )
  82. Echo       Or ZIP2ZIP G:\DIR20\ ABC?XYZ  (DOES ABC_XYZ.ZIP ABC1XYZ.ZIP etc.)
  83. Echo       Or ZIP2ZIP E:\ *              (DOES ROOT of E: , ALL ZIPS)
  84. Echo                              Do NOT enter the .EXT of .ZIP
  85. GoTo End
  86.  
  87. :MajorError
  88.     Echo A Required Program IS NOT Present OR There Exists A
  89.     Echo Major Logic Error. Do NOT Continue Until Fixed.
  90.     GoTo End
  91.  
  92. :REQ_SD
  93.     Echo %1Z_B, A Needed "WORK" SubDirectory Already exists..Canceling
  94.     Echo Explore %1Z_B. If it's from prior test work
  95.     Echo Position yourself in %1. Use ZIPRDZ_B.BAT To Remove Z_B.
  96.     GoTo End
  97.  
  98. :WRONG_PK
  99.     Echo Must be using PKZIP version 2.04g
  100.     Echo Run   PkZIP -L  to see your version no. etc.
  101.     GoTo End
  102.  
  103. :OOPS
  104.     Echo %1%2.ZIP Not Here!
  105.  
  106. :End
  107.       For %%f IN ( FSIZE ZDATE ZTIME CNZL EVCHK40 EVCHK30 SAFETY ) DO Set %%f=
  108.       For %%f IN ( Temp_$$$.Bat ZIP2-FSZ. EV0.FLG ) DO IF Exist %%f Del %%f >Nul
  109. Rem   IF Exist %1ZIP2ZIP.CVT DEL %1ZIP2ZIP.CVT >Nul
  110. Rem   Saving ZIP2ZIP.CVT File until next run. User may want to use as Move lst
  111.